import request from "@/request/request";
import qs from "qs";
// export const JingpinAPI = function () {
//   return request.get("/products/recommend");
// };
//==================
// 获取精品列表接口
export const JingpinAPI = () => request.get("/products/recommend");
//获取热门兑换接口
export const ReMenAPI = () => request.get("/products/hot");
//获取验证码接口
export const GetVerificationCodeAPI = (phoneNumber) =>
  //将请求去参数序列化 qs.stringify
  request.post("/sendSMS", qs.stringify(phoneNumber));
//手机验证码登录请求接口
export const PhoneLoginAPI = (params) =>
  //将请求去参数序列化 qs.stringify
  request.post("/phoneRegin", qs.stringify(params));

//微信扫码登录接口
export const WeChatLoginAPI = (params) =>
  request.post("/wechatUsers/PCLogin", qs.stringify(params));

//手机绑定微信接口
export const WeChatBindingAPI = (params) =>
  request.post("/wechatUsers/binding", qs.stringify(params));
//获取用户信息接口
export const UserProfilesAPI = (params) => request.get("/shop/userProfiles");
//请求详情接口
export const GoodsDetailAPI = (id) => request.get(`/products/${id}`);
//添加到购物车
export const addToCartAPI = (params) =>
  request.post("/shop/carts/add", qs.stringify(params));
//获取商品列表
export const GetGoodsListAPI = (params) => request.get("/products", { params }); //{params:params}

//查看购物车
export const ShowCartAPI = () => request.get("/shop/carts");
//删除商品接口
export const deleteTheGoodsAPI = (id) => request.delete(`/shop/carts?productIds=${id}`);

